<template>
	<view class="whitePage" :style="{backgroundImage: `url(${imgUrl}manager/topBg.png)`}">
		<!-- 顶部导航条 -->
		<u-navbar bgColor="transparent" titleStyle="color: transparent" leftIconColor="#fff" autoBack placeholder />
		<!-- 用户信息 -->
		<view class="flex user">
			<u--image  
				:src="infoData.avatar"
				width="96rpx"
				height="96rpx"
				shape="circle"
			/>
			<text class="head-txt">{{ infoData.nickName }}</text>
			<u-icon name="arrow-right" color="#fff" size="40rpx" />
		</view>
		<view class="pad30">
			<!-- 提现 -->
			<view class="priceBox" :style="{backgroundImage: `url(${imgUrl}pay1.png)`}">
				<text>提现金额</text>
				<view class="flex">
					<text>{{ infoData.money || 0 }}</text>
					<view style="align-self: flex-end;">元</view>
					<u-button color="linear-gradient(#fde5a5, #f9e29f, #dcbc73)" shape="circle" size="small" text="提现" />
				</view>
			</view>
			<!-- 导航列表 -->
			<view class="operation flex">
				<view
					v-for="(item, index) in setList"
					:key="index"
					@click="goRouter(item.menuLink)"
				>
					<u--image :src="item.menuIcon" width="66rpx" height="66rpx" />
					<view class="li-tit">{{ item.menuName }}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
import { imgUrl } from '@/utils/baseUrl.js';
import { getWorkInfo } from "@/api/doctor.js";
import { managerHomeMenu } from "@/api/admin.js"
export default {
	data() {
		return {
			imgUrl,
			setList: [],
			infoData: {}
		}
	},
	onLoad(eve) {
		managerHomeMenu({roleCode: eve.type}).then(res => this.setList = res)
		getWorkInfo().then(res => this.infoData = res)
	},
	methods: {
		//跳转页面
		goRouter(url) {
			if(url.includes('patientList')) {
				url += `?sign=${this.infoData.sign}`
			}
			uni.navigateTo({ url })
		}
	}
}
</script>

<style lang="scss" scoped>
.whitePage {
	background-repeat: no-repeat;
	background-size: 100% 312rpx;
}
.user {
	padding: 38rpx 34rpx 50rpx 26rpx;
	text {
		flex: 1;
		font-size: 36rpx;
		font-weight: bold;
		color: #ffffff;
		margin-left: 32rpx;
	}
}
.priceBox {
	height: 190rpx;
	border-radius: 20rpx;
	background-size: 100% 100%;
	padding: 20rpx 40rpx;
	color: #fff;
	::v-deep .flex {
		margin-top: 44rpx;
		text {
			font-size: 64rpx;
			font-weight: bold;
			line-height: 28rpx;
			padding-right: 10rpx;
		}
		.u-button {
			width: 130rpx;
			margin: 0 0 0 auto;
		}
	}
}
::v-deep .operation {
	flex-wrap: wrap;
	padding-top: 40rpx;
	font-size: 24rpx;
	.u-image {
		margin: auto;
	}
	> view {
		width: 33.33%;
		text-align: center;
	}
	.li-tit {
		margin: 20rpx 0;
	}
}
</style>
